Operator Overloading in C
نویسنده
چکیده
This thesis is concerned with investigating an approach for adding problem notation to a computer language. A method is proposed for modifying a programming language to fit problem notation by including the capability of defining a problem specific set of symbols or operators in the language. The proposed method for extending a language uses operator overloading to map language operations to the problem notation. This method is shown to be feasible for the case where the language is defined through a context free grammar and where the problem abstractions are implemented through object services or functions. We also show how generalized operator overloading can be used to resolve some of the language difficulties implicit in C, which cannot be done through C++ operator overloading. A preprocessor for C was built to study the problems and effects of adding generalized operator overloading to a language. Experience with this method suggests that problems may occur when encoding the semantic variations for a problem service, selecting unambiguous operator symbols, and implementing general language extensions for assignment operations and identifier references. Host language support for reference variables is necessary. Our results indicate that generalized operator overloading can be used to provide a domain specific problem notation that is user defined, but processed by C code.
منابع مشابه
Cmpsci 377 Operating Systems 3.1 Operator Overloading in C++
It allows you to provide an intuitive interface to users of your class, plus makes it possible for templates to work equally well with classes and built-in/intrinsic types. Operator overloading allows C/C++ operators to have user-defined meanings on user-defined types (classes). Overloaded operators are syntactic sugar for function calls: Fred f(const Fred& a, const Fred& b, const Fred& c) { re...
متن کاملGeneralizing Overloading for C++2000
This paper outlines the proposal for generalizing the overloading rules for Standard C++ that is expected to become part of the next revision of the standard. The focus is on general ideas rather than technical details (which can be found in AT&T Labs Technical Report no. 42, April 1,1998).
متن کاملEfficient Implementation of Portable C*-like Data-Parallel Library in C++
The C* language is a data-parallel extension of the C language which incorporates parallel data types. Since the C ++ language provides operator overloading, a C ++ library can implement the C* parallel extensions with a similar syntax. Although library implementations are highly portable, some overheads make them impractical. The two major overheads incurred are temporaries in each operator ap...
متن کاملHow to Express C++ Concepts in Fortran90
This paper summarizes techniques for emulating in Fortran90 the most important object-oriented concepts of C++: classes (including abstract data types, encapsulation and function overloading), inheritance and dynamic dispatching.
متن کاملEfficient Expression Templates for Operator Overloading-based Automatic Differentiation
Expression templates are a well-known set of techniques for improving the efficiency of operator overloading-based forward mode automatic differentiation schemes in the C++ programming language by translating the differentiation from individual operators to whole expressions. However standard expression template approaches result in a large amount of duplicate computation, particularly for larg...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1995